/**
 *****************************************************************************
 * @file
 * @brief
 * @author taoye
 * @version V0.0.1
 * @date 2021/08/24
 ****************************************************************************
 */
#ifndef DRV_GPIO_H
#define DRV_GPIO_H

#include "drv_include.h"

/* private config -----------------------------------------------------------*/
typedef struct
{
    GPIO_TypeDef *      port;
    uint16_t            pin;
}gpio_private_t;

/* Public defines -----------------------------------------------------------*/
typedef struct  drv_gpio            drv_gpio_t;

/* Public enum    -----------------------------------------------------------*/
typedef enum
{
    INPUT_UP,
    INPUT_DOWN,
    OUTPUT_UP,
    OUTPUT_DOWN,
    ANALOG_MODE,
}gpio_mode_e;

typedef enum
{
    LOW_LEVEL,
    HIGHT_LEVEL,
    NULL_LEVEL,
}gpio_initlevel_e;

/* Public Struct  -----------------------------------------------------------*/
struct drv_gpio
{
    /* ***************Public Parameter  *************** */
    const char *        PIN;
    gpio_mode_e         MODE;
    gpio_initlevel_e    INIT_LEVEL;

    /* ***************Public Method     *************** */
    void    ( *Write ) ( drv_gpio_t *, uint8_t );
    uint8_t ( *Read )  ( drv_gpio_t * );

    /* ***************Private Attributes*************** */
    gpio_private_t  private;
};


/* Public Variable  ---------------------------------------------------------*/
//Pointer

//Array

//Const

/* Pubilc function prototypes -----------------------------------------------*/
int Drv_Gpio_Init(drv_gpio_t *this);






#endif
